package com.order.Client;

import com.order.Client.impl.AccountImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import spring.cloud.Utils.R;

/**
 * @author cyt
 * @create 2020-06-07 17:28
 */
@FeignClient(name = "seata-account", fallback = AccountImpl.class)
@Component
public interface AccountClient {
    /**
     * 调用
     * @param userId
     * @param num
     * @return
     */
    @RequestMapping("/account/dec/{userId}/{num}")
    public R decAccount(@PathVariable("userId") Integer userId, @PathVariable("num") Integer num);
}
